﻿using RockBus.Initialization.Interfaces;
using RockBus.Logging.Interfaces;
using System.Collections.Generic;

namespace RockBus.Initialization
{
    public class InitializationManager : IInitializationManager
    {
        public InitializationManager(
            ILogger logger,
            IInitialization[] initializations
            )
        {
            this.Logger = logger;
            this.Initializations = new List<IInitialization>(initializations);
        }

        private ILogger Logger { get; set; }

        private List<IInitialization> Initializations { get; set; }

        public void Initialize()
        {
            foreach (var initialization in this.Initializations)
            {
                initialization.Initialize();
            }
        }
    }
}